import { defineConfig } from "vitepress";
import { fileURLToPath, URL } from "node:url";
import vueJsx from "@vitejs/plugin-vue-jsx";
import VueMacros from "unplugin-vue-macros";
import {
  containerPreview,
  componentPreview,
} from "@vitepress-demo-preview/plugin";
// https://vitepress.dev/reference/site-config
export default defineConfig({
  title: "My Awesome Project",
  description: "A VitePress Site",
  vite: {
    plugins: [
      VueMacros.vite({
        setupComponent: false,
        setupSFC: false,
        plugins: {
          vueJsx: vueJsx(),
        },
      }),
    ],
    resolve: {
      alias: {
        "@": fileURLToPath(new URL("../../src", import.meta.url)),
      },
    },
  },
  markdown: {
    config(md) {
      md.use(containerPreview);
      md.use(componentPreview);
    },
  },
  themeConfig: {
    // https://vitepress.dev/reference/default-theme-config
    nav: [
      { text: "Home", link: "/" },
      { text: "Examples", link: "/markdown-examples" },
      { text: "Test", link: "/markdown-examples" },
    ],

    sidebar: [
      // {
      //   text: 'Examples',
      //   items: [
      //     { text: 'Markdown Examples', link: '/markdown-examples' },
      //     { text: 'Runtime API Examples', link: '/api-examples' },
      //     { text: 'Test here', link: '/api-examples' }
      //   ]
      // },
      {
        text: "组件",
        items: [
          { text: "Button", link: "/components/button" },
          { text: "Switch", link: "/components/switch" },
          { text: "Select", link: "/components/select" },
          { text: "OverflowTooltip", link: "/components/OverflowTooltip" },
          { text: "TableSearch", link: "/components/TableSearch" },
          { text: "MultipInput", link: "/components/MultipInput" },
          { text: "ListPaper", link: "/components/ListPaper" },
        ],
      },
    ],

    socialLinks: [],
  },
});
